package com.hades.example.java.refactoring.before.c11.c11_7_extract_superclass;

import java.util.ArrayList;
import java.util.List;

public class Department {
    private String _name;
    private List<Employee> _staff = new ArrayList<>();

    public Department(String name) {
        _name = name;
    }

    public int getTotalAnnualCost() {
        int result = 0;
        for (Employee each : _staff) {
            result += each.getAnnualCost();
        }
        return result;
    }

    public int getHeadCount() {
        return _staff.size();
    }

    public void addStaff(Employee arg) {
        _staff.add(arg);
    }

    public String getName() {
        return _name;
    }
}
